﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DAO;
using DTO;

namespace BUS
{
    public class SanPhamBUS
    {
        public List<SanPhamDTO> LayThongTinSanPham()
        {
            SanPhamDAO dao = new SanPhamDAO();
            return dao.LayThongTinSanPham();

        }
        public List<SanPhamDTO> LayThongTinSanPham(string maSP)  // 
        {
            SanPhamDAO dao = new SanPhamDAO();
            return dao.LayThongTinSanPham(maSP);
        }
        public int LaySoLuongTon(string MaSP)
        {
            SanPhamDAO dao = new SanPhamDAO();
            return dao.LaySoLuongTon(MaSP);
        }
        public int CapNhatSoLuongSanPham(int soluong, string MaSP)
        {
            SanPhamDAO dao = new SanPhamDAO();
            return dao.CapNhatSoLuongSanPham(soluong, MaSP);
        }
        public string MaSPMoi()
        {
            SanPhamDAO dao = new SanPhamDAO();
            string kq = dao.TaoMaSPMoi();
            return kq;
        }
        public int ThemSanPham(SanPhamDTO spDTO)
        {
            SanPhamDAO dao = new SanPhamDAO();
            int kq = dao.ThemSanPham(spDTO);
            return kq;

        }
    }
}
